home *** CD-ROM | disk | FTP | other *** search
/ JCSM Shareware Collection 1993 November / JCSM Shareware Collection - 1993-11.iso / cl760 / edgraphj.lzh / EXPANDME.EXE / lha / BAR1.GRF < prev    next >
Text File  |  1992-11-19  |  2KB  |  67 lines

  1. {------------------------------------------------------------------------
  2. { BAR1.GRF - EdGraph demo program (bar graph)
  3. {            Copyright (c) A Soft Answer, 1992.
  4. {
  5. { Type - AltV to see this demo, or
  6. {      - AltP to print it, but first...SPECIFY WHAT PRINTER YOU ARE USING:
  7. {--------------------------------------------------------------------------}
  8. Printer=1;   { Change the value to one of these, depending on your printer:}
  9.              {      1 = Generic 9 pin dot matrix,                          }
  10.              {   2..7 = Epson: 2=MX, 3=RX, 4=FX, 5=EX, 6=LX, 7=LQ          }
  11.              {   8..9 = IBM: 8=ProPrinter, 9=QuietWriter                   }
  12.              {     10 = NEC 24 pin                                         }
  13.              {     11 = Toshiba 24 pin                                     }
  14.              { 12..13 = HP: 12=DeskJet, 13=LaserJet                        }
  15.              {     14 = PostScript printers                                }
  16. {--------------------------------------------------------------------------}
  17.  
  18. PgHeight=120; PgWidth=150; Orientn=1; Res=1;
  19. Initialise(Printer,PgHeight,PgWidth,Orientn,Res,"LPT1");
  20.  
  21. { Choose font and bar filling depending on the specified printer }
  22. Fill1=1; Fill2=50; If Printer>11; Fill1=10; Endif;
  23. If Printer=14; {PostScript}
  24.   FontID=3;
  25. Else;
  26.   {select font and fill style depending on printer resolution}
  27.   If ((Printer=6) or (Printer=7) or (Printer>9)) and (Res>0);
  28.     FontID=1;
  29.   Else;
  30.     FontID=0;
  31.   Endif;
  32. Endif;
  33.  
  34. NewPlot(-3.5,0,3.5,25,30,100,20,80,0,0);
  35.  
  36. DefineFont(1,FontID,14,16,0,0,1,1,"");
  37. DefineFont(2,FontID,12,16,0,0,1,1,"");
  38. SelectFont(1);
  39.  
  40. AxisStyle(1,0,1,4,0,10,1,2,0,0,1,1,2,2,1);
  41. AxisStyle(0,0,1,2,0,12,1,2,1,0,1,1,2,2,2);
  42.  
  43. box(-3.5,0,3.5,25,Fill1);
  44. xaxis("Event",0,-3,1,2,1,0,1);
  45. yaxis("Response",-3.5,0,5,2,1,1,1);
  46.  
  47. procedure Data1;       {Note that the data can be varied by j, to}
  48.   -3+j   5.2    6.5    {shift the bars slightly left or right    }
  49.   -2+j   8.3    6.4
  50.   -1+j   12.1   15.6
  51.      j   18.5   17.2
  52.    1+j   23.7   21.5
  53.    2+j   20.2   21.3
  54.    3+j   12.3   11.1
  55.   EndPoints;
  56. EndProc;
  57.  
  58. clip(1);
  59. Shadow(1,1,1);
  60. SelectFont(2);
  61. LegendTable(-3.3,24.5,43,2);
  62. Shadow(0.5,0.5,1);
  63. j=0.1; points(1,2,0,0,-1,5,0,Fill2,2,"Data set 2");
  64. Data1;
  65. j=-j; points(1,3,0,0,-1,5,0,0,1,"Data set 1");
  66. Data1;
  67.